var WxParse = require('../../../wxParse/wxParse.js');
var app = getApp()
Page({
  data: {

  },
  onLoad: function (options) {
    this.loadDetail()
  },
  loadDetail() {
    let self = this
    app.request({
      url: '/home/api/server',
      method: 'POST',
      success: (res) => {
        console.log(res.result.server)
        self.downloadPdf(res.result.server)
        // var article = res.result.detail;
        // WxParse.wxParse('article', 'html', article, self, 5);
        // self.setData({
        //   info: res.result
        // })
      }
    })
  },
  downloadPdf(url){
    wx.downloadFile({
      url: url, 
      success(res) {
        const filePath = res.tempFilePath
        wx.openDocument({
          filePath,
          success(res) {
            console.log('打开文档成功')
          }
        })
      }
    })
  }
})